000 Help for SB1.txt for SB1.exe an Interpreter rev 2021-03-02 for post.
2012-02-13 restart SB1 from Simple Interpreter which was a partial remake of SB.bas.

Drag and drop *.txt file onto SB1.exe to run it.
Or Select All (or part) of program from WP and Copy to Clipboard and Open SB1 and accept the clipboard contents as the program to run.

First word|symbol if not ' comment is considered a var or cmd or label: none of which are case sensitive.
		
Delimiters Review:
For file lines, Chr$(13) + Chr$(10)
Comma is most likely delimiter, 
but space is used after a cmd, after a var being assigned or in numeric expressions.
But ; used with print cmds . , ; and ?, ?n, n? inputs after prompt.

For setting numeric variable values think space in numeric expressions, nothing new here!
Syntax: MyVariableName = expression delimited by spaces that will be trimmed to 1 space  
	( separate variables inside parenthesis with space ) ( example1 ) ( example2a + example2b )
Here you can't use spaces in variable names, because Evaluate depends on space delimiters.
	
For all string functions (SFunctions) use commas to delimit arguments 
Syntax: var SFunction arg1, arg2, arg3
If the arg is a literal, place first char (or if space) next to comma. 
Best to contain literals in vars ASAP but literals without commas should work.
They would start right after requited space for SFunction name or comma and end with next comma or end of line.

Line Labels end with : (and a space as they are a cmd) and are NOT case sensitive. Include : in Goto or GS (gosub).
 		  
To start a print line with set amount of spaces use / to mark the start (not printed).
(note: if you do see / being printed then it is NOT 1 space past the ; or . print cmd.

Use your favorite editor to write your program, I use Notepad++ It needs to separate lines with Chr$(13) + Chr$(10). QB64 IDE has allot of nice things like Syntax checking and and line formatting but it doesn't have a SpellChecker nor Tabbed Files ability.
 
Drag and drop *.txt file onto SB1.exe to run it.

=====================================  OUTPUT Commands 
For printing text: Divide arguments with ; (also for ? the input command, everything else divides by , except numeric expressions which are divided by spaces)
' to ignore line, nothing might work specially started with space 
 
. anything;/    lead with spaces;var ; more stuff to end of line.
    use ; for delimiter and wrap variables in them
	use / (which will not be printed) to mark start of set amount of spaces.
	
; arg1; arg2; var; some more test but continue next print here>
    use for mixing variables(values plugged-in) and literals
    and stops next print will start where last left off.
	
, tabs the args into neat columns until a . command stops it.	
	
Tab n arg2; arg3;...     - n is column width then args in columns

Tag xpix, ypix, message$  - This is just _PrintString under a different name: xpix, ypix are the coordinate of top left corner of label 16 pix high, 8*len(message$)long.
 
Have It Both Ways for Locate:
 	
Loc row, col    - for locating next character cell for print or input place, l for locate

At col, row     - reverse x, y like Basic graphics

Show TF      - TF (False = 0 ) turns off _Display, (True <> 0) turns on _Display use True if in a loop and getting blinking, use False to see everything printed immediately.
 
Wait secs -   for pausing

Cls (none color might be good)   - to clear clutter

Zzz - Sleep is called, holds up exec until key press

==================================== INPUT
? or n? or ?n for Input, use n with ? if want a return of 0 instead of an empty string if user just hits Enter. 
? prompt; varToLoad 
Just like the Basic we love except without the double quotes, !!! please dont use dbl quotes !!! 

===============================    EXECUTION FLOW

LineLabel:    - sets line label in program for GoTo or GS, no spaces, Not case sensitive. Under-the-hood like commands they are stored temporarily for program mapping.

GoTo lineLabel:  - redirects flow to mark lineLabel ( do not enter or exit a sub with go )

GS LineLabel: - redirects flow to sub routine, gs for gosub

Rtn             - signals exit back to call point of sub routine, rtn for return

Wait secs     - will pause the given amount of seconds

End             - exits program run

===========================   LOOPING 

[ - marks start of loop, think do

] - marks the end of loop, required with ], think loop

Exit - commands exit from loop, think exit

Jmp expression - jump out of loop if expression evaluates to -1, this saves us from extra If and Fi lines.

==========   BOOLEAN or If ElseIf Else End If BLOCKS 

If 0|NOT (-1) expression  - AKA IF block start, followed by Boolean or numeric expression to evaluate.

EI 0|NOT - AKA ElseIf, as many as you need or none just about equivalent to If the boolean is False look for El or Fi

El       - AKA Else optional, marks line to goto if Boolean evaluates false

Fi       - AKA End If, marks end of Boolean block "Final If line"

note: 2021-02-17 bad idea to use single letter names mnemonics: need something to help remember or make sense of this shorthand

If - the same
EI - ElseIf 
El - Else
Fi - Finale If block line marker

	
+=, -=, *=, /= commands short for x = x + 1 now it's x += 1
+= var,change numeric expression  var = var + result of expression 
-= var,change expression 
and so on.

+  var = Sum all variables or literals eg   + Sum a1, a2, a3,.. Sum = a1+a2+a3...

- var, arg1, arg2, arg3... - ei var = Arg1 - Arg2 - Arg3 -....

* varName, a1, a, a3... - you guessed it! Product.  eg MyProduct = a1 * a2 *  a3 * ...

& varName, a1, a2, a3... - concatenate strings, eg & myCatGot mouse1, and mouse 2, and mouse 3... myCatGot mouse1 and mouse2 and mouse3  

Get and Set work with Array Strings (Astring) a string containing many items glued together by the same delimiter in-between each item to separate but link the items. Each item in such a string can be loaded or queried as needed by index number, hey just like an array!

Set Astring, index, value    - compare to A(i) = value

Get myGetVarToLoad, Astring, index  - compare to MyVar = A(i)

If you want a "numeric" array string to return a 0 if never loaded with another value, you better preload your Astring.
Oh BTW all array strings are Base 1 and don't have to be Dim'd and they are Dynamic until you run out of memory meaning you keep adding to them.

eg Load an Astring with 0's 1 to 100
[
	n = n + 1
	Jmp n > 100
	Set Astring, n, 0
]
Through program run: Set Astring, index, value - it's like A(i) = value
Assign one of those values to myLoadVar: Get myLoadVar, Astring index - it's like var = A(i)
			
Syntax for setting variable with SFunctions:
VarName StrFunctionName a1, a2, a3,...

There is no Eval for Strings so you have to do multi-step mods to string a step at a time.

Here are some Str Functions:
var SPC n - set a var to a number of spaces 

var Mid$ Str$, start#, nChars#  - standard Mid$ Function with 3 args

var Head Str$, divideStr$ - from divideStr$ you get a head the front part and..

var Tail Str$, divideStr$ - the right side of the divideStr$ AKA LeftOf$, RightOf$

var Instr2 Str$, search$  - find where the Search$ starts in Str$

var Instr3 Start#, Str$, search$ - this version has a start place to begin search on string.

var Len Str$ - reports Length in Chars of Str$

var $= a1, a2  - if a1 = a2 as strings then var gets -1 True, else var gets 0, nutt'n

var Date - date  - var contains the result

var Time - time -  var contains the result

var Ucase a1  -  a1 is all Cap and stored in var

var Lcase a1 - a1 is all lower case, var contains the result

var A$Sort Astring - sorts string A-Z, var contains the result

var D$Sort Astring - sorts strings into Z-A order, var contains the result

var A#Sort Astring - sorts numbers low to high, var contains the result

var D#Sort Astring - sorts numbers high to low order, var contains the result

var Split anyStringDelimiterLinked, delimiter$, Astring$

var Join Astring delimiter anotherAstring - effectively removing one set of delinuter for another.
This should really be called Rejoin and there should be another like & 
Join varAstring, delimiter$, a3, a4, a5, a6.... varString = a3Da4Da5D... 

var Chr a1  - var = Chr$(a1)

var Asc a1  - var = ASC(a1)

var Ltrim a1 - var = LTrim$(a1) trimmed (spaces removed) on Left side

var Rtrim a1 - var = RTrim$(a1) trimmed (spaces removed) on Right side.

var Trim a1 - var = _Trim$(a1)

var NCopy a1, a2 - var = N(a1) Strings(a2) eg 

Preloaded variables and values:
MT = ""
Xmax = 1024 ' 128 Columns  Screen Size
Ymax = 672 '   = 42 Lines
Rmax = 42  'max Row for Locate or At
Cmax - 128 ' max column for Locate or At

ProgramMap structure: (under-the-hood)
Type ProgramLine
    Cmd As String '     filter out all less than ascii 33 = head, tail ends in first space after
    ArgLine As String ' first space to acsii 13 + ascii 10 (CR+LF) for Notepad++ editor of like 
    LoopLevel As Long ' like how many indents in
    IFLevel As Long   ' how many more indents in cuurent loop
    GoToAlt As Long '   If False in IF block, I think GS AKA Gosub uses this too, it's under the hood.
    GoToT As Long '     for line labels and subs or ending a True exec IF Block
End Type
